pids=$(ps -ef | grep start_integrated.py | grep -v grep | awk '{print $2}')
if [ -n "$pids" ]; then
    echo "Killing process: $pids"
    echo "$pids" | xargs kill
fi

arg=$1
if [ $arg == "" ]
then
nohup python3.13 start_integrated.py >> app.log 2>&1 &
elif [ $arg == 1 ]
then
git pull && nohup python3.13 start_integrated.py >> app.log 2>&1 &
elif [ $arg == 2 ]
then
git pull && nohup python3.13 start_integrated.py >> app.log 2>&1 &
tail -f app.log
else
echo "没有匹配到参数模式"
exit 8
fi
echo "Started start_integrated.py with PID $!"
